package com.bwie.auth.feign.factory;

import com.bwie.auth.feign.AdminFeign;
import com.bwie.common.domain.Admin;
import com.bwie.common.result.Result;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Author：作者姓名
 * @Package：com.bwie.auth.feign.factory
 * @Project：_yk
 * @name：Factory
 * @Date：2024/5/17 9:28
 */
@Component
public class Factory implements FallbackFactory<AdminFeign> {
    @Override
    public AdminFeign create(Throwable cause) {
       return new AdminFeign() {
           @Override
           public Result<Admin> FindBy(String userName) {
               throw new RuntimeException("服务器异常");
           }
       };
    }
}
